import React, { Component} from 'react'
import './index.less'
import PropTypes from 'prop-types'

export default class IconInfo extends Component {

  PropTypes:{
    iconInfo: PropTypes.object.isRequired,
  }

  render () {
    const { iconInfo } = this.props
    return (
      <div className='user-information flex-wrap'>
        <div className='flex-2 header-img'>
          <img src={iconInfo.icon} alt='' />
          <div className='user-name-box'>
            <p className='user-name'>{iconInfo.username}</p>
            <p className='comment-date-box'>
              <span className='comment-date'>{iconInfo.commentDate}</span>
            </p>
          </div>
        </div>
        {this.props.children && this.props.children}
      </div>
    )
  }
}

IconInfo.propTypes = {
  iconInfo: PropTypes.object
}
